<%--
  Created by IntelliJ IDEA.
  User: owner
  Date: 2018-08-02
  Time: 12:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@include file="../../include/back/BackHeader.jsp"%>
<%@include file="../../include/back/BackNavigator.jsp"%>
<title>分类管理</title>
<div class="Back_categorylist">
    <span class="label label-info Back_categorylist_tab">分类信息</span>
    <span hidden <c:if test="${!empty param.delete}"> class="nodelete" </c:if> id="deleteSpan">
    </span>
    <table class="table table-bordered table-hover table-striped table-condensed Back_categorylist_table">
        <thead>
            <tr>
                <th>ID</th>
                <th>图片</th>
                <th>分类名称</th>
                <th>属性管理</th>
                <th>产品管理</th>
                <th>编辑</th>
                <th>删除</th>
            </tr>
        </thead>
        <tbody>
             <c:forEach items="${categories}" var="cat" varStatus="st">
                 <tr>
                     <td>${cat.id}</td>
                     <td><img height="40px" src="img/category/${cat.id}.jpg"></td>
                     <td>${cat.name}</td>
                     <td><a href="admin_property_list?cid=${cat.id}"><span class="glyphicon glyphicon-th-list"></span></a></td>
                     <td><a href="admin_product_list?cid=${cat.id}"><span class="glyphicon glyphicon-shopping-cart"></span></a></td>
                     <td><a href="admin_category_edit?cid=${cat.id}"><span class="glyphicon glyphicon-edit"></span></a></td>
                     <td><a href="admin_category_delete?cid=${cat.id}" deleteLink="true"><span class="glyphicon glyphicon-trash"></span></a></td>
                 </tr>
             </c:forEach>
        </tbody>
    </table>
</div>
<%@include file="../../include/back/BackPage.jsp"%>
<div class="Back_categoryadd">
    <div class="panel panel-default">
        <div class="panel-heading">新增分类</div>
        <div class="panel-body">
            <form  action="admin_category_add" method="post" id="category_form" enctype="multipart/form-data">
                <table class="addTable">
                    <tr>
                        <td> <label for="category_name">分类名称</label></td>
                        <td> <input type="text" id="category_name"  name="category_name" ></td>
                    </tr>
                    <tr>
                        <td><label  for="category_file">分类图片</label></td>
                        <td>
                            <input type="file" id="category_file"  name="category_file" accept="image/*">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center">
                            <button class="btn btn-success" type="submit" id="category_addbutton">提交</button>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<%@include file="../../include/back/BackFooter.jsp"%>


